from Utils.router import router
from Utils.zj import mallcoodatas


@router.get('/zj/mallcoodata')  # 猫酷数据接口
async def mallcoodata():
    Active_members = mallcoodatas.Active_member()  # 活跃会员
    genders = mallcoodatas.gender()  # 性别
    card_levels = mallcoodatas.card_level()  # 卡类
    new_members_monththis = mallcoodatas.new_members_month()  # 本月新增会员
    new_members_todaythis = mallcoodatas.new_members_today()  # 昨日新增会员
    Proportion_of_consumption = mallcoodatas.Proportion_of_consumption()  # 会员消费哦占比
    FloorComps = mallcoodatas.get_floor_Consumption_points()
    return {'Active_member': {'Active_member': Active_members},
            'genders': {'mangender': genders[0], 'womangender': genders[1]},
            'card_level': {'Gold_card': card_levels[0], 'Internal_card': card_levels[1], 'Diamond_card': card_levels[2],
                           'Wyatt_card': card_levels[3], 'Merchant_employee_card': card_levels[4]},
            'new_members': {'new_members_monththis': new_members_monththis,
                            'new_members_todaythis': new_members_todaythis},
            'Proportion_of_consumption': Proportion_of_consumption, 'floorCops': FloorComps}
